package main

import (
	maker2 "api/libs/maker"
	"gitee.com/dreamwood/ez-maker/maker"
)

func main() {
	maker2.Prepare()
	RequestLog()
}

func RequestLog() {
	doc := maker.CreateDocument("EZRequestLog", "请求日志", "logs")
	doc.Add("ChainKey", "ChainKey").IsString()
	doc.Add("HOST", "HOST").IsString()
	doc.Add("Method", "Method").IsString()
	doc.Add("URL", "URL").IsString()
	doc.Add("RequestURI", "RequestURI").IsString()
	doc.Add("Referer", "Referer").IsString()
	doc.Add("RemoteAddr", "RemoteAddr").IsString()
	doc.Add("UserAgent", "UserAgent").IsString()
	doc.Add("XAUTHTOKEN", "X-AUTH-TOKEN").IsString()
	doc.Add("AccessToken", "Access-Token").IsString()
	doc.Add("Request", "Request").IsString()
	doc.Add("Response", "Response").IsString()
	doc.Add("CreateAt", "创建时间").IsTime()
	doc.Add("Flag", "Flag").IsString()
	doc.Generate()
}

////ChanKey:
//bf.WriteString(fmt.Sprintf("%s\n", operation.ChainKey))
////HOST:
//bf.WriteString(fmt.Sprintf("%s\n", operation.Input.Request.Host))
////Method:
//bf.WriteString(fmt.Sprintf("%s\n", operation.Input.Request.Method))
////URL:
//bf.WriteString(fmt.Sprintf("%s\n", operation.Input.Request.URL))
////RequestURI:
//bf.WriteString(fmt.Sprintf("%s\n", operation.Input.Request.RequestURI))
////Referer:
//bf.WriteString(fmt.Sprintf("%s\n", operation.Input.Request.Referer()))
////RemoteAddr:
//bf.WriteString(fmt.Sprintf("%s\n", operation.Input.Request.RemoteAddr))
////User-Agent:
//bf.WriteString(fmt.Sprintf("%s\n", operation.Input.Request.Header.Get("User-Agent")))
////X-AUTH-TOKEN:
//bf.WriteString(fmt.Sprintf("%s\n", operation.Input.Request.Header.Get("X-AUTH-TOKEN")))
////Access-Token:
//bf.WriteString(fmt.Sprintf("%s\n", operation.Input.Request.Header.Get("a-auth-token")))
////Request:
//bf.WriteString(fmt.Sprintf("%v\n", string(operation.Input.Json)))
////Response:
//bf.WriteString(fmt.Sprintf("%v\n", operation.Output.Writer.String()))
